﻿//  --------------------------------
//  Copyright (c) Microsoft Corporation. All rights reserved.
//  This source code is made available under the terms of the Microsoft Public License (Ms-PL)
//  http://www.codeplex.com/oxite/license
//  ---------------------------------
using System;
using System.Web;
using System.Web.Mvc;
using Oxite.Extensions;
using ECube.Web.CMS.Models;
using System.Web.Script.Serialization;
namespace ECube.Web.CMS.ModelBinders
{
    //public class PageInputModelBinder : IModelBinder
    //{
    //    public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
    //    {
    //        HttpRequestBase request = controllerContext.HttpContext.Request;

    //        if (string.Compare(request.HttpMethod, HttpVerbs.Post.ToString(), true) == 0)
    //        {

    //            if (request.ContentType.Contains("application/json"))
    //            {
    //                string inputContent;
    //                using (var sr = new System.IO.StreamReader(request.InputStream))
    //                {
    //                    inputContent = sr.ReadToEnd();
    //                }
                   
    //                PageInput input =  new PageInput("templateName", "title", "description", "slug", null);

    //                input.PageProfile = PageProfile.FromJson(inputContent);

    //                return input;
    //            }



               
    //        }

    //        return null;
    //    }
    //}
}
